package org.mango.bean;


import com.baidu.unbiz.fluentvalidator.annotation.FluentValidate;
import org.hibernate.validator.constraints.NotBlank;
import org.mango.validator.B3Validator;
import org.mango.validator.anno.Refer;
import org.mango.validator.fluent.common.IdcardValidator;
import org.mango.validator.fluent.common.ZipCodeValidator;
import org.mango.validator.group.G1;
import org.mango.validator.refer.AOneBNotNullValidator;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

/**
 * Created by meigang on 17/9/15.
 */
public class A {

    @NotNull
    private int a0;
    @NotBlank
    @FluentValidate({ZipCodeValidator.class})
    private String a1;

    @FluentValidate({IdcardValidator.class})
    @Refer(validator = AOneBNotNullValidator.class,
            groups = {G1.class},
            param = {"org.mango.bean.C:a1=440403"},
            message = "a2的值在a1=440403，才不能为空")
    private String a2;
    @Valid
    private B b;

    public int getA0() {
        return a0;
    }

    public void setA0(int a0) {
        this.a0 = a0;
    }

    public String getA1() {
        return a1;
    }

    public void setA1(String a1) {
        this.a1 = a1;
    }

    public String getA2() {
        return a2;
    }

    public void setA2(String a2) {
        this.a2 = a2;
    }

    public B getB() {
        return b;
    }

    public void setB(B b) {
        this.b = b;
    }
}
